package com.infosys.cabplanningdao;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;

import com.infosys.cabplanning.common.domain.Cab;
import com.infosys.cabplanning.common.domain.CriteriaDTO;
import com.infosys.cabplanning.common.domain.Driver;
import com.infosys.cabplanning.common.domain.Employee;
import com.infosys.cabplanning.common.domain.Schedule;
import com.infosys.cabplanning.common.domain.TripDetails;
import com.infosys.cabplanningdao.cab.dao.CabServiceDAO;
import com.infosys.cabplanningdao.driver.dao.DriverDAO;
import com.infosys.cabplanningdao.emp.dao.EmployeeDAO;
import com.infosys.cabplanningdao.schedule.ScheduleDAO;
import com.infosys.cabplanningdao.trip.dao.TripDAO;

public class CabPlanningDAOServiceImpl implements CabPlanningDAOService{
	
	@Autowired
	private DriverDAO driverDAO;
	
	@Autowired
	private CabServiceDAO cabServiceDAO;
	
	@Autowired
	private ScheduleDAO scheduleDAO;
	
	@Autowired
	private TripDAO tripDAO;
	
	@Autowired
	private EmployeeDAO employeeDAO;

	@Override
	public void saveDriver(List<Driver> driverList) {
		driverDAO.save(driverList);
	}

	@Override
	public List<Driver> findDriver(Driver driverSearchDTO) {
		return driverDAO.findDriver(driverSearchDTO);
	}

	@Override
	public void saveCab(List<Cab> cabList) {
		cabServiceDAO.saveCab(cabList);
	}

	@Override
	public List<Cab> findCabs(Cab cabSearchDTO) {
		return cabServiceDAO.findCabs(cabSearchDTO);
	}

	@Override
	public List<Schedule> findSchedules(Schedule scheduleSearchDTO) {
		return scheduleDAO.getAllSchedule(scheduleSearchDTO);
	}

	@Override
	public void saveTripDetails(List<TripDetails> tripDetailsList) {
		tripDAO.saveTripDetails(tripDetailsList);
	}

	@Override
	public List<TripDetails> getTripDetails(CriteriaDTO criteriaDTO) {
		return tripDAO.getTripDetails(criteriaDTO);
	}

	@Override
	public List<Employee> getEmployees(Schedule schedule) {
		return employeeDAO.getEmployeesForSchedule(schedule);
	}
}
